package com.info.zhiduoduo.pay.controller;

import com.info.zhiduoduo.common.constants.SmartResult;
import com.info.zhiduoduo.common.validator.IntIn;
import com.info.zhiduoduo.pay.formbean.pinganpay.*;
import com.info.zhiduoduo.pay.formbean.zhaoshangbankpay.*;
import com.info.zhiduoduo.pay.service.PinganBankPayService;
import com.info.zhiduoduo.pay.service.ZhaoShangBankPayService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/pingan")
public class PinganBankPayController {

    @Resource
    PinganBankPayService pinganBankPayService;

    /**
     * 平安银行查询账号接口 BEDL_4001
     *
     * @param formBean
     * @return
     */
    @ApiOperation("平安银行查询账号接口")
    @PostMapping("/balanceQuery")
    public SmartResult balanceQuery(@Valid @RequestBody PinganQueryFormBean formBean) {
        return pinganBankPayService.balanceQuery(formBean);
    }

    /**
     * 企业单笔资金划转_银企直联
     *
     * @param formBean
     * @return
     */
    @ApiOperation("平安银行企业单笔资金划转接口")
    @PostMapping("/singleTransfer")
    public SmartResult singleTransfer(@Valid @RequestBody PinganTransferFormBean formBean) {
        return pinganBankPayService.singleTransfer(formBean);
    }

    /**
     * 平安银行单笔转账指令查询接口
     *
     * @param formBean
     * @return
     */
    @ApiOperation("平安银行单笔转账指令查询接口")
    @PostMapping("/singleTransferQuery")
    public SmartResult singleTransferQuery(@Valid @RequestBody PinganTransferQueryFormBean formBean) {
        return pinganBankPayService.singleTransferQuery(formBean);
    }

    /**
     * 企业单笔资金划转_银企直联
     *
     * @param formBean
     * @return
     */
    @ApiOperation("平安银行企业批量资金划转接口")
    @PostMapping("/batchTransfer")
    public SmartResult batchTransfer(@Valid @RequestBody PinganBatchTransferFormBean formBean) {
        return pinganBankPayService.batchTransfer(formBean);
    }

    /**
     * 平安银行单笔转账指令查询接口
     *
     * @param formBean
     * @return
     */
    @ApiOperation("平安银行批量转账指令查询接口")
    @PostMapping("/batchTransferQuery")
    public SmartResult batchTransferQuery(@Valid @RequestBody PinganBatchTransferQueryFormBean formBean) {
        return pinganBankPayService.batchTransferQuery(formBean);
    }
}
